#ifndef DEVICESMEM_H_INCLUDED
#define DEVICESMEM_H_INCLUDED

#include "stdint.h"

/* 模拟动态内存大小 */
#define DEVICES_MEM_LENGTH          (1024 * 1)


typedef struct{
    int32_t startAddr: 30;
    int32_t stopAddr: 30;
    uint32_t state: 2;
}MemType;


/* 动态内存头部信息 */
extern MemType g_typeMemHead;


void vMemInit(void);
void vMemCreate(MemType *ptypeMemHanle, uint8_t *pucMemHeap, int32_t iLength);
void *pvMemMalloc(MemType *ptypeMemHanle, int32_t iSize);
void *pvMemCalloc(MemType *ptypeMemHanle, int32_t iNumber, int32_t iSize);
void *pvMemRealloc(MemType *ptypeMemHanle, void *pvMemAddr, int32_t iSize);
void vMemFree(MemType *ptypeMemHanle, void *pvMemAddr);

#endif // DEVICESMEM_H_INCLUDED
